package com.ccit.course.api;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ccit.common.exception.GymException;
import com.ccit.common.exception.fileUpload.FileEmptyException;
import com.ccit.common.result.Result;
import com.ccit.common.utils.UploadUtil;
import com.ccit.course.controller.CourseController;
import com.ccit.course.service.CourseService;
import com.ccit.model.Course;
import com.ccit.model.CourseOrder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Api(tags = "课程管理")
@RestController
@RequestMapping("/api/course")
public class CourseApiController {
    @Autowired
    private UploadUtil uploadUtil;

    @Autowired
    private CourseService courseService;

    final String port = "8085";

    @ApiOperation(value = "根据id查课程")
    @GetMapping("/getCourseById/{id}")
    public Course getCourseById(@PathVariable Long id) {
        Course course = courseService.getById(id);
        return course;
    }

}
